package com.aj.http.response;

import org.json.JSONException;
import org.json.JSONObject;

import com.aj.databases.entry.FamilyMember;

public class QueryFamilyResponse extends BaseRespond {
	private FamilyMember familyMember;

	public QueryFamilyResponse(JSONObject json) {
		super(json);
		try {
			if (common.getResult() != null) {
				JSONObject jsonObject = common.getResult();
				familyMember = new FamilyMember();
				if (!jsonObject.isNull("userId")) {
					familyMember.setUser_id(jsonObject.getString("userId"));
				}
				if (!jsonObject.isNull("ajNo")) {
					familyMember.setAjNo(jsonObject.getString("ajNo"));
				}
				if (!jsonObject.isNull("nickName")) {
					familyMember.setNickName(jsonObject.getString("nickName"));
				}
				if (!jsonObject.isNull("trueName")) {
					familyMember.setTrueName(jsonObject.getString("trueName"));
				}
				if (!jsonObject.isNull("six")) {
					familyMember.setSix(jsonObject.getString("six"));
				}
				if (!jsonObject.isNull("birthday")) {
					familyMember.setBirthday(jsonObject.getString("birthday"));
				}
				if (!jsonObject.isNull("age")) {
					familyMember.setAge(jsonObject.getString("age"));
				}
				if (!jsonObject.isNull("sign")) {
					familyMember.setSign(jsonObject.getString("sign"));
				}
				if (!jsonObject.isNull("photo")) {
					familyMember.setPhoto(jsonObject.getString("photo"));
				}
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public FamilyMember getFamilyMember() {
		return familyMember;
	}

	public void setFamilyMember(FamilyMember familyMember) {
		this.familyMember = familyMember;
	}

}
